home *** CD-ROM | disk | FTP | other *** search
/ Diccionario Visual Trilingue / VISUAL.iso / SHARED.DIR / 10005_Language Buttons Script.ls < prev    next >
Encoding:
Text File  |  1997-07-04  |  1.8 KB  |  66 lines

  1. global gTextLanguage, gHighLightPos, gHighLightPosC, gOldTextLanguage, gIndexChange, gContenuChange
  2.  
  3. on mouseDown
  4.   set SpriteNums to [22, 21, 23, 26, 25, 27, 31, 40]
  5.   set ButtonType to [1, 1, 1, 2, 2, 2, 3, 4]
  6.   repeat with i = 1 to 8
  7.     set SpriteNum to getAt(SpriteNums, i)
  8.     if rollOver(SpriteNum) then
  9.       if pushButtonScript(SpriteNum) then
  10.         if getAt(ButtonType, i) = 1 then
  11.           InterfaceChange(i)
  12.         else
  13.           if getAt(ButtonType, i) = 2 then
  14.             TextChange(i - 3)
  15.           else
  16.             if getAt(ButtonType, i) = 3 then
  17.               CancelLanguagePalette()
  18.             else
  19.               if not (gTextLanguage = gOldTextLanguage) then
  20.                 set gIndexChange to 1
  21.                 set gContenuChange to 1
  22.               end if
  23.               CloseLangPrefPalettes()
  24.             end if
  25.           end if
  26.         end if
  27.       end if
  28.       return 
  29.     end if
  30.   end repeat
  31. end
  32.  
  33. on pushButtonScript SpriteNum
  34.   set inside to 1
  35.   set theName to the name of cast the castNum of sprite SpriteNum
  36.   if (theName starts "I.ac.") or (theName starts "T.ac.") then
  37.     set offset to 0
  38.   else
  39.     set offset to 1
  40.   end if
  41.   set the castNum of sprite SpriteNum to the castNum of sprite SpriteNum + offset
  42.   updateStage()
  43.   repeat while the mouseDown
  44.     if rollOver(SpriteNum) then
  45.       if not inside then
  46.         set the castNum of sprite SpriteNum to the castNum of sprite SpriteNum + offset
  47.         set inside to 1
  48.         updateStage()
  49.       end if
  50.       next repeat
  51.     end if
  52.     if inside then
  53.       set the castNum of sprite SpriteNum to the castNum of sprite SpriteNum - offset
  54.       set inside to 0
  55.       updateStage()
  56.     end if
  57.   end repeat
  58.   if inside then
  59.     set the castNum of sprite SpriteNum to the castNum of sprite SpriteNum - offset
  60.     updateStage()
  61.     return 1
  62.   else
  63.     return 0
  64.   end if
  65. end
  66.